// pages/results/results.js
var app = getApp();
Page({
  data: {
    index:0,
    time:"",
    remark: ["好极了！你很棒棒哦", "哎哟不错哦", "别灰心，继续努力哦！"], // 评语
  },
  onLoad: function (options) {
    console.log(options);
    this.setData({
      time: options.time,
      index: options.index
    })
  },
  //上传数据
  onUnload:function()
  {
    let that=this
    let openid=wx.getStorageSync('openid');
    let recite=[]
    let reciteItem={}
    reciteItem.index=that.data.index
    reciteItem.time=that.data.time
    recite = Object.assign({},reciteItem);
    // test=that.data.questionList.test
    console.log(recite)
    wx.cloud.callFunction({
      name:"updata",
      data:{
        action:"userList_recite_update",           
        openid:openid,
        recite:recite
      }
    })
  },
  // 返回首页
  toIndex: function () {
    wx.redirectTo({
      url: '../home/home',
    })
  },
})